home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Games Collection 1 / software vault.zip / software vault / CDR10 / YICN23.ZIP / INCLUDE / ICON.H < prev    next >
C/C++ Source or Header  |  1993-02-06  |  2KB  |  50 lines

  1. #ifndef ICON.H
  2.  
  3. #define ICON.H
  4.  
  5. #include "stddefs.h"
  6. #include "yaklib.h"
  7.  
  8. class icon
  9. {
  10. public:
  11.   enum flagType {normal = 0, fast = 1};
  12.   int width, height;
  13.   flagType flags;
  14.   char * unrolledPic;
  15.   icon() {width = height = byteWidth = 0; flags = normal; unrolledPic = NULL; collisionMap = NULL;};
  16.   ~icon() {delete unrolledPic; delete collisionMap;};
  17.   inline byte getPixel(int x, int y);
  18.   void save(char * filename);
  19.   char * useData(unsigned char * myPointer, flagType iflags = normal);
  20.   char * load(char * filename, flagType iflags = normal, yakLib * myYakLib = NULL);
  21.   inline void show(int x, int y, word offset);
  22.   inline void hide(int x, int y, word to_offset, word from_offset);
  23.   inline void showMasked(int x, int y, word offset);
  24.  
  25. //collision system code parts inserted here.  All icons will have collision
  26. //maps.
  27.  
  28.   byte * collisionMap; //contains collision points
  29.   int byteWidth; //width in bytes.
  30.   int setWPacked(int, int); //allocates space for array
  31.   int setCollisionBit(int ix, int iy, booleanFlags flag = on);
  32.   int getCollisionBit(int ix, int iy);
  33.   void spewCollisionTable(void);
  34.   int makeCollisionMap(void);
  35.   int hitXY(int myX, int myY, icon* target, int targetX, int targetY);
  36. // icon zooming code parts inserted here.  Only one zoomtable will exist for
  37. // all icons.
  38.  
  39.   static byte ** zoomTable;
  40.   static int zoomTableWidth;
  41.   static byte ** setZoomTable(int newWidth);
  42.   static void spewZoomTable(void);
  43.   icon * zoomedIcon(int newWidth);
  44.   void showZoomed(int x, int y, word offset, int newWidth);
  45. };
  46.  
  47. char * unRollBlt(char * rolledBlt, int &iwidth, int &iheight);
  48. char * rollBlt(char * unRolledBlt, int &iwidth, int &iheight);
  49.  
  50. #endif